#ifndef RUNTIME_MUTEX
#define RUNTIME_MUTEX

#include "../prims/jni.h"
#include "stdint.h"

class Thread;

union SplitWord{
    volatile intptr_t FullWord;
    volatile jbyte Bytes[sizeof(intptr_t)];
};

class Monitor{
protected:
    SplitWord _LockWord;
private:
    int TryFast();
    int TrySpin();
public:
    void ILock(Thread *Self);
    void IUnlock();
};


#endif